package com.doit.day02;

import com.doit.day01.MyTools;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;
import redis.clients.jedis.Pipeline;

import java.util.Locale;

public class _02_发布和订阅 {
    public static void main(String[] args) {
        Jedis jedis = MyTools.getJedis();
        jedis.publish("A","this message from idea");
       /* jedis.subscribe(new JedisPubSub() {
            @Override
            public void onMessage(String channel, String message) {
                if (channel.equals("A")){
                    //处理逻辑
                    System.out.println(message.toUpperCase(Locale.ROOT));
                }else if(channel.equals("B")){
                    System.out.println(message+"=> B");
                }else {
                    System.out.println("订阅玩的，不想看是啥");
                }

            }
        },"A","B","C");*/



    }
}
